﻿
namespace Main.Extend
{
    public static class Extend
    {

        #region string 类型的扩展
        public static bool IsNullOrEmpty(this string str)
        {
            return string.IsNullOrEmpty(str);
        }
        public static string GetGuid(this string str)
        {
            return Guid.NewGuid().ToString().Replace("-", "");
        }
        public static string Format(this string str, params object?[] args)
        {
            return string.Format(str, args);
        }

        #endregion

        #region int 类型的扩展



        #endregion


        #region 时间类型的扩展
        public static string ToDateString(this DateTime date)
        {
            return date.ToString("yyyy/MM/dd");
        }
        public static string ToTimeString(this DateTime date)
        {
            return date.ToString("HH:mm:ss");
        }
        public static string ToDateTimeString(this DateTime date)
        {
            return date.ToString("yyyy/MM/dd HH:mm:ss");
        }
        #endregion
    }
}
